
public class City {

    public static void main(String[] args) {
        City city = new City("Beijing", 118.3, 38.2);

        System.out.println(city);
    }
    private String name;
    private double longitute;
    private double latitude;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getLongitute() {
        return longitute;
    }

    public void setLongitute(double longitute) {
        this.longitute = longitute;
    }

    public double getLatitude() {
        return latitude;
    }

    public void setLatitude(double latitude) {
        this.latitude = latitude;
    }

    public City(String s, double longitute, double lat){
        name = s;
        this.longitute = longitute;
        latitude = lat;
    }

    @Override
    public String toString(){
        return this.getClass()+ " . City name:" + name + " Location: ("+ longitute+","+ latitude+").";
    }
}
